Many network-based file systems use cryptographic signatures to ascertain the validity of packets being sent to and from a file server. For example, when a client sends a packet to the file server, the client calculates a signature using the data in the packet and attaches the signature to the packet. During the signature calculation, the client must not allow the data, from which the signature is calculated, to change. However, in a shared memory architecture, the client can run multiple processes that share the data. Some of the processes may need to modify the data during and/or after the signature calculation, but before the data is sent. The period of time during and/or after the signature calculation, before the data is sent, may be referred to as a “stable data period.” System performance will be degraded if these processes are forced to stall until the calculation is completed and the data is sent.
Conventionally, a client copies all of the data (which is to be sent to a file server) into a separate buffer before signature calculation starts. Copying all of the data is inefficient and slow. In scenarios where none of the processes modify the data (e.g., the processes only read the data or do not modify the data) during the stable data period, performing the data copying is not only unnecessary, but also wastes system resources. However, in a conventional client computer system where the address space of the processes is memory-mapped, the operating system kernel generally has no way of knowing if and when the data is going to be modified.
Other client computer systems use a method known as copy-on-write, which makes a copy of a shared page when a process attempts to modify the shared page. However, with copy-on-write, only the process performing the write operation will have access to the new copy. Thus, none of the other processes can share the content of the new copy.